package day3.demo3_hashmap;

import java.util.*;

public class Test {
    public static void main(String[] args) {
        HashMap<String,Integer> hm = new HashMap();
        hm.put("a1",139);
        hm.put("a2",188);
        hm.put("a1",188);

        System.out.println(hm.size());
        System.out.println(hm.containsKey("a1"));
        System.out.println(hm.containsValue(139));

//        Set<Map.Entry<String,Integer>> sets = hm.entrySet();
//        for (Map.Entry<String, Integer> t : sets) {
//            System.out.println(t.getKey() + ":" + t.getValue());
//        }

//        Set<String> keys = hm.keySet();
//        for (String k : keys) {
//            System.out.println(k + ":" + hm.get(k));
//        }

        Collection<Integer> values = hm.values();
        for (Integer v : values) {
            System.out.println(v);
        }

        HashSet hs = new HashSet();
        hs.add("dd");
    }
}
